Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Normalizing Vectors

QuickDraw 3D provides routines that you can use to normalize a vector. The normalized form of a vector is the vector having the same direction as the given vector but a length equal to 1.0.

Q3Vector2D_Normalize

You can use the Q3Vector2D_Normalize function to normalize a two-dimensional vector.

TQ3Vector2D *Q3Vector2D_Normalize (
                     const TQ3Vector2D *vector2D,
                     TQ3Vector2D *result);
vector2D
A two-dimensional vector.
result
On exit, the normalized form of the specified vector.

DESCRIPTION

The Q3Vector2D_Normalize function returns, as its function result and in the result parameter, the normalized form of the vector vector2D . Note that on entry the result parameter can be the same as the vector2D parameter.

Q3Vector3D_Normalize

You can use the Q3Vector3D_Normalize function to normalize a three-dimensional vector.

TQ3Vector3D *Q3Vector3D_Normalize (
                     const TQ3Vector3D *vector3D,
                     TQ3Vector3D *result);
vector3D
A three-dimensional vector.
result
On exit, the normalized form of the specified vector.

DESCRIPTION

The Q3Vector3D_Normalize function returns, as its function result and in the result parameter, the normalized form of the vector vector3D . Note that on entry the result parameter can be the same as the vector3D parameter.


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |